<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        * {
            padding: 0;
            margin: 0;
        }
        body {
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            justify-items: center;
            align-items: center;
            justify-content: center;
            background-color: black;
        }

        a {
            display: inline-block;
            position: relative;
            color: #FFF;
            text-decoration: none;
            padding: 10px 30px;
            margin: 10px 0;
            border-radius: 40px;
            letter-spacing: 2px;
            background-image: linear-gradient(90deg, #0162c8, #55e7fc);
            overflow: hidden;
        }
        a:nth-child(2) {
            background-image: linear-gradient(90deg, #e435a1, #fceb55);
        }

        span{
            position: absolute;
            background: #fff;
            transform: translate(-50%, -50%);
            border-radius: 50%;
            animation: frames 500ms linear infinite;
        }

        @keyframes frames {
            0% {
                width: 0px;
                height: 0px;
                opacity: 0.5;
            }
            100% {
                width: 500px;
                height: 500px;
                opacity: 0;
            }
        }
    </style>

</head>
<body>
    <a href="#">button</a>
    <a href="#">button</a>

    <script>
        let buttons = document.querySelectorAll('a');
        buttons.forEach(bn=>{
            bn.addEventListener('click', function(e) {
                let x = e.clientX - e.target.offsetLeft;
                let y = e.clientY - e.target.offsetTop;


                let ripple = document.createElement('span');
                ripple.style.left = x + 'px';
                ripple.style.top = y + 'px';
                this.appendChild(ripple)

                setTimeout(()=>{
                    ripple.remove()
                }, 500)
            })
        })
    </script>
</body>
</html>